var Pagination = {

    data() {
        return {
            pagination: {
                pageSizes: [10, 20, 50, 100],
                total: 0,
                pageSize: 10,
                currentPage: 1
            }
        }
    },

    methods: {

        /**
        * 修改分页条数
        */
        onSizeChange(pageSize: number) {
            this.pagination.pageSize = pageSize;
            this.loadDataForPagination();
        },

        /**
         * 翻页
         */
        onFlipOver(currentPage: number) {
            this.pagination.currentPage = currentPage;
            this.loadDataForPagination();
        },

        /**
         * 重置分页信息
         */
        resetPagination() {
            // @ts-ignore
            this.pagination.total =  0;
            this.pagination.pageSize =  10;
            this.pagination.currentPage =  1;
        },

        /**
         * 加载数据
         */
        loadDataForPagination() { 
            console.error('subComponent must be implement loadDataForPagination Function!');
        }
    }
}

export default Pagination;